stringlist: Export gtk_string_object_new()
authorBenjamin Otte <otte@redhat.com>
Sat, 4 Jul 2020 15:02:44 +0000 (17:02 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 5 Jul 2020 00:59:21 +0000 (02:59 +0200)
There are various use cases where it makes sense to construct these -
from our internal testing to using them in flatten- or mapmodels.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkstringlist.c
gtk/gtkstringlist.h

index 437092116c0b045e6c153df5608907de56844161..c6da63ac74ac5d3721cd7008c3aa2baf605ea075 100644 (file)
@@ -7611,7 +7611,9 @@ gtk_string_list_take
 gtk_string_list_remove
 gtk_string_list_splice
 gtk_string_list_get_string
+<SUBSECTION>
 GtkStringObject
+gtk_string_object_new
 gtk_string_object_get_string
 </SECTION>
 
index 608081d5002452066564d15a2fe69513032a03b8..2555e1f8f3b9db60774d7abaa1e72a7286e37ee6 100644 (file)
@@ -156,7 +156,15 @@ gtk_string_object_new_take (char *string)
   return obj;
 }
 
-static GtkStringObject *
+/**
+ * gtk_string_object_new:
+ * @string: (non-nullable): The string to wrap
+ *
+ * Wraps a string in an object for use with #GListModel
+ *
+ * Returns: a new #GtkStringObject
+ **/
+GtkStringObject *
 gtk_string_object_new (const char *string)
 {
   return gtk_string_object_new_take (g_strdup (string));
index 17be87864b7c1df797cf6aaeb67273a6ed96b0d6..c426a915422cfd028d441a6df8d2881308c83479 100644 (file)
@@ -37,7 +37,9 @@ GDK_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (GtkStringObject, gtk_string_object, GTK, STRING_OBJECT, GObject)
 
 GDK_AVAILABLE_IN_ALL
-const char *         gtk_string_object_get_string (GtkStringObject *self);
+GtkStringObject *       gtk_string_object_new        (const char      *string);
+GDK_AVAILABLE_IN_ALL
+const char *            gtk_string_object_get_string (GtkStringObject *self);
 
 #define GTK_TYPE_STRING_LIST (gtk_string_list_get_type ())